/**
 * 文件网格视图样式
 */
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 16px;

  .grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;

    &:hover {
      border-color: #1890ff;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

      .grid-item-actions {
        opacity: 1;
      }
    }

    &.selected {
      border-color: #1890ff;
      background-color: #e6f7ff;
    }

    &.editing {
      border-color: #1890ff;
      background-color: #e6f7ff;
    }

    .grid-item-checkbox {
      position: absolute;
      top: 8px;
      left: 8px;
      z-index: 1;
    }

    .grid-item-icon {
      font-size: 48px;
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 64px;
      height: 64px;
    }

    .grid-item-name {
      text-align: center;
      font-size: 14px;
      color: #333;
      word-break: break-all;
      line-height: 1.4;
      margin-bottom: 8px;
      width: 100%;
      max-height: 2.8em;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .grid-item-info {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      font-size: 12px;
      color: #666;
      margin-bottom: 8px;

      span {
        text-align: center;
      }
    }

    .grid-item-actions {
      display: flex;
      gap: 8px;
      opacity: 0;
      transition: opacity 0.2s ease;

      .ant-btn-link {
        padding: 4px 8px;
        height: auto;
        font-size: 12px;
        
        .anticon {
          font-size: 12px;
        }
      }
    }

    .ant-input {
      text-align: center;
      font-size: 14px;
      margin-bottom: 8px;
    }
  }
}

// 响应式设计
@media (max-width: 768px) {
  .grid-view {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 12px;

    .grid-item {
      padding: 12px;

      .grid-item-icon {
        font-size: 36px;
        width: 48px;
        height: 48px;
      }

      .grid-item-name {
        font-size: 12px;
      }

      .grid-item-info {
        font-size: 10px;
      }
    }
  }
}
